﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;

public partial class Admin_Staff_ChangePasswordStaff : AdminBasePage
{
    protected void Page_Load(object sender, EventArgs e)
    {
        if (!isLogin())
        {
            Response.Redirect("~/Admin/Index.aspx");
        }
    }
    protected void Button1_Click(object sender, EventArgs e)
    {
        DALStaff  c = new DALStaff();
        tblStaff staff = null;
        Hash cipher = new Hash();
        if (isLogin())
        {
            if (TextBox1.Text == TextBox2.Text)
            {
                staff = LoginedStaff;
                staff.Password = cipher.hash(TextBox1.Text);
                c.updateStaff(staff);
                Label3.Text = "Password Successfully Changed";
            }
            else
            {
                Label3.Text = "Un-Matched password, please check again";
            }

        }
    }
}